﻿using MaterialDesignThemes.Wpf;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using UIWindow.Attributes;
using UIWindow.Domains;
using UIWindow.ViewModels;
using UIWindow.ViewModels.Dialogs;
using UIWindow.Views.Dialogs;

namespace UIWindow
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DataContext = new MainWindowViewModel();
        }

        private void DialogHost_Loaded(object sender, RoutedEventArgs e)
        {
            if (!GlobalStart.IsDeBug) _ = DialogHost.Show(new LoginDialogs() { DataContext = new LoginDialogsViewModel() }, "RootDialog").ConfigureAwait(false);
            WindowState = WindowState.Maximized;
            //IntPtr intPtr = new WindowInteropHelper(this).Handle;
            //_ = SetWindowPos(intPtr, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
        }

        private void ButExit_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            Application.Current.Shutdown();
        }

        private void Mini_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            WindowState = WindowState.Minimized;
        }
    }
}
